﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.ComponentModel;

namespace Dissemination.MVC.Models
{
    [MetadataType(typeof(TestResultMetaData))]
    public partial class TestResult
    {
        /// <summary>
        /// 
        /// </summary>
        public int TestResultTotalAnswers
        {
            get
            {
                return TestResultCorrectAnswers + TestResultIncorrectAnswers + TestResultNotAnswered;
            }
        }

        [Bind(Exclude = "TestResultID")]
        public class TestResultMetaData
        {
            [DisplayName("CorrectAnswers")]
            public int TestResultCorrectAnswers { get; set; }

            [DisplayName("IncorrectAnswers")]
            public int TestResultIncorrectAnswers { get; set; }

            [DisplayName("NotAnswered")]
            public int TestResultNotAnswered { get; set; }
        }
    }
}